package com.fastjars.mybatis.dynamic;

/**
 * DBHolder
 * 本地线程设置和获取数据源信息
 * @author Brant Liu <br> 邮箱：<br>lbf1988@qq.com <br>日期：<br>2018/10/10
 * @version 1.0.0
 */
public class DBHolder {
    private static final ThreadLocal<DBType> holder = new ThreadLocal<DBType>();

    public static void putDataSource(DBType dataSource){
        holder.set(dataSource);
    }

    public static DBType getDataSource(){
        return holder.get();
    }

    public static void clearDataSource() {
        holder.remove();
    }
}
